<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{
			padding: 0px;
			margin: 0px;
			list-style: none;
		}
		.box{
			width: 500px;
			height: 340px;
			margin: 50px auto;
			overflow: hidden;
		}
		.title{
			width: 500px;
			height: 40px;
		}
		.title .item{
			width: 20%;
			height: 40px;
			text-align: center;
			line-height: 40px;
			color: #000;
			float: left;
			background: #F5F5F5 url() 0 0 no-repeat;
			cursor: pointer;
		}
		.title  .active{
			background:  #80B600  url() 0 0 no-repeat;
			color: #fff;
		}

		.content{
			width: 500%;
			height: 300px;
			position: relative;
			left: 0px;
		}
		.content .item{
			width: 500px;
			height: 300px;
			text-align: center;
			line-height: 300px;
			font-size: 60px;
			color: #fff;
			background: #80B600 url() 0 0 no-repeat;
			float: left;
		}
	</style>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script type="text/javascript">
		$(function () {
			
			$('.title .item').click(function(event) {

				// $(this).css({'background':'#80B600','color':'#fff'}).siblings().css({'background':'#F5F5F5','color':'#000'})
				
				$(this).addClass('active').siblings().removeClass('active');
				
				left = $(this).index()*-500;

				$('.content').animate({left:left+"px"}, 500);
			});
		})
	</script>
</head>
<body>
	<div class="box">
		<ul class="title">
			<li class="item active">tab1</li>
			<li class="item">tab2</li>
			<li class="item">tab3</li>
			<li class="item">tab4</li>
			<li class="item">tab5</li>
		</ul>
		<ul class="content">
			<li class="item">content1</li>
			<li class="item">content2</li>
			<li class="item">content3</li>
			<li class="item">content4</li>
			<li class="item">content5</li>
		</ul>
	</div>
</body>
</html>